async function loadPluginInfo(manifestPath) {
  try {
    const response = await fetch(manifestPath);
    const manifest = await response.json();

    document.getElementById('plugin-name').textContent = manifest.name;
    document.getElementById('plugin-version').textContent = manifest.version;
    document.getElementById('plugin-description').textContent = manifest.description;
    document.getElementById('plugin-category').textContent = manifest.category;
    
    // 处理注意事项
    const rulesList = document.getElementById('plugin-rules');
    const noRulesMessage = document.getElementById('no-plugin-rules');

    if (manifest.rules && manifest.rules.length > 0) {
        rulesList.style.display = 'block';
        noRulesMessage.style.display = 'none';
        rulesList.innerHTML = ''; // 清空原有内容
        manifest.rules.forEach(rule => {
            const li = document.createElement('li');
            li.textContent = rule;
            rulesList.appendChild(li);
        });
    } else {
        rulesList.style.display = 'none';
        noRulesMessage.style.display = 'block';
    }
  } catch (error) {
    console.error('加载插件信息失败:', error);
  }
}

export { loadPluginInfo };
